package com.db.rome.monitoring.csv;

import com.db.rome.monitoring.DataStorage;
import com.db.rome.monitoring.domain.ConnectionStatus;

/**
 * User: gryaale
 * Date: 8/12/14
 */
public class ConnectionStatusCsvReader extends AbstractCsvReader {

    public ConnectionStatusCsvReader(DataStorage dataStorage) {
        super(dataStorage);
    }

    @Override
    protected void process(String[] cols) {
        String connectionName = cols[0];
        String connectionStatus = cols[1];
        String lastHeartbeat = cols[2];
        String lastTradeMsgInTime = cols[3];
        String lastTradeMsgOutTime = cols[4];
        String source = cols[5];
        String target = cols[6];
        String connectionType = cols[7];

        ConnectionStatus connectionStatusObject = new ConnectionStatus(connectionName, connectionStatus, lastHeartbeat,
                lastTradeMsgInTime, lastTradeMsgOutTime, source, target, connectionType);
        dataStorage.getConnectionStatusList().add(connectionStatusObject);
    }
}
